package com.snbc.Exception;

/**
 * @Classname Hero
 * @Description TODO
 * @Date 2019/9/15 21:48
 * @Created by Acer
 */
public class Hero {
    public String name;
    public float hp;

    public String toString() {
        return name;
    }

    public void attackHero(Hero h) throws EnemyHeroIsDeadException {
        if (h.hp == 0) {
            throw new EnemyHeroIsDeadException(h.name + " 已经挂了,不需要施放技能");
        }
    }
}
